/****************************************************************
 *This file is main.c
 ****************************************************************/

#include "include.h"

/****************************************************************
 *This function is main process,
 *	(1)first init system source
 *	(2)create five thread
 *	(3)obstruct main process,and let five thread to run
 ****************************************************************/
int main(void)
{
	//inner variable
	pthread_t pth1, pth2;
	int ret;

	//none meaning,avoid compile warning
	ret = 0;
	ret = ret;

	//***********system init********************//
	system_init();

	//set signal process function
	signal(SIGPIPE, sig_pro_func);

	//give system running notice
	fprintf(stderr,"If no warning notice,system_init ok! \n");
	fprintf(stderr,"I will schedule pthread and start my work!	:) \n");

	//***********create    thread****************//
	//creat thread1
	ret = pthread_create(&pth1, NULL, thread1, NULL);

	//creat thread2
	ret = pthread_create(&pth2, NULL, thread2, NULL);

	//************let	thread	 to   run************//
	//let thread1  to run
	pthread_join(pth1, NULL);

	//let thread2  to run
	pthread_join(pth2, NULL);

	//not run to this, so we should reboot system
	fprintf(stderr,"master module thread was exit!\n");

	return 0;

}

#ifdef	TST_CODE_SWITCH
	//fprintf(stderr,"judgement_exist_time is :%x\n",judgement_exist_time);
#endif

